package com.lp.cronservice;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.DependsOn;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;


/**
 * 
 * 定时器服务
 *
 */
@DependsOn(value="baseDao")
@Service("CronDataService")
public class CronDataServiceImpl {
	
	// 线程层
	@Autowired
	private TaskExecutor taskExecutor ;

	@Autowired
	private CronServiceThread cronServiceThread ;
	
	@Scheduled(cron = "0 0 0 * * ?")
	private void HistoryDataTable() {
		// 
		taskExecutor.execute(cronServiceThread.new HistoryTableData());
	}
	
	
	@Scheduled(cron = "*/50 * * * * ?")
	private void deviceNodeOffLine() {
		// 
		taskExecutor.execute(cronServiceThread.new DeviceNodeOffLine());
	}
	
	@Scheduled(cron = "*/60 * * * * ?")
	private void SysHealthCheck() {
		// 
		taskExecutor.execute(cronServiceThread.new SysHealthCheck());
	}
	
	@Scheduled(cron = "*/100 * * * * ?")
	private void DeviceStatusInfo() {
		// 
		taskExecutor.execute(cronServiceThread.new DeviceStatusMaintain());
	}
}
